package util;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

public class DigitController extends KeyAdapter {

	 public void keyTyped(KeyEvent e)
	   {
	      char caracter = e.getKeyChar();

	      // Verify if the key typed is a number
	      if(((caracter < '0') ||
	         (caracter > '9')) &&
	         (caracter != '\b' /*BACK_SPACE*/))
	      {
	         e.consume();  // ignore keyboard event
	      }
	   }
}
